// 挂载变量
import {
	BASE_URL,
	API_URL,
	IMG_URL,
	WEB_URL
} from '../env.js';
import store from '@/shouyun/store';
import http from '@/shouyun/request';
import tools from '@/shouyun/utils/tools';

const install = Vue => {
	Vue.prototype.$BASE_URL = BASE_URL;
	Vue.prototype.$API_URL = API_URL;
	Vue.prototype.$IMG_URL = IMG_URL;
	Vue.prototype.$WEB_URL = WEB_URL;
	// 挂载请求
	Vue.prototype.$http = http;
	// 挂载工具函数
	Vue.prototype.$tools = tools;
}

export async function init(options) {
	await store.dispatch("appInit", options); // 加载APP基本信息
}

export default {
	install
}
